<%@page import="helpers.DateHelper"%>
<%@page import="java.util.Locale"%>
<%@page import="java.text.NumberFormat"%>
<%@page import="models.OrderModel"%>
<%@page language="java" contentType="text/html; charset=UTF-8" %>
<%			
	OrderModel order = (OrderModel) request.getAttribute("order");
	NumberFormat nf = NumberFormat.getNumberInstance(Locale.GERMAN);
%>
<jsp:include page="/admin/layouts/header.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>

<script type="text/javascript">
	jQuery(document).ready(function () {
		jQuery(".leftmenu ul li").removeClass("current");
		jQuery(".leftmenu ul li a.sell").parent().addClass("current");
	});
</script>

		<div class="maincontent noright">
        	<div class="maincontentinner">
        		<%
        			if(order!=null&&!order.getOrderId().isEmpty()){
        		%>
                <ul class="maintabmenu multipletabmenu">
                	<li class="current"><a href="#">Đơn hàng chi tiết</a></li>
                </ul><!--main tab menu-->
                
                <div class="content">				                  
                    <!--content title-->         
                    <jsp:include page="/admin/elements/message.jsp"/>       
                    <form method="post" class="stdform stdform2" id="add_deal">                    	
	                    <div class="contenttitle">
	                    	<h2 class="form"><span>Thông tin tài khoản</span></h2>
	                    </div>
						<p>
                        	<label>Chủ tài khoản : </label>
                            <span class="field">
                            	<%=order.getUsername() %>
                            </span>                          
						</p>   
						<p>
                        	<label>Tên người nhận : </label>
                            <span class="field">
                            	<%=order.getShipName() %>
                            </span>                          
						</p>   
						<p>
                        	<label>Điện thoại : </label>
                            <span class="field">
                            	<%=order.getShipPhoneNumber() %>
                            </span>                          
						</p>  
						<p>
                        	<label>Địa chỉ : </label>
                            <span class="field">
                            	<%=order.getShipAddressFull() %> 
                            </span>                          
						</p>   
						<%
							if(order.getNote()!=null&&!order.getNote().isEmpty()){
						%>
						<p>
                        	<label>Ghi chú khách hàng : </label>
                            <span class="field">
                            	<%=order.getNote() %> 
                            </span>                          
						</p>  
						<%
							}
						%> 
						
						<div class="contenttitle">
	                    	<h2 class="form"><span>Thông tin đơn hàng</span></h2>
	                    </div>
	                    <p>
                        	<label>Mã đơn hàng : </label>
                            <span class="field">
                            	<%=order.getOrderId() %>
                            </span>                          
						</p>  
						 <p>
                        	<label>Thời gian đặt hàng : </label>
                            <span class="field">
                            	<%=DateHelper.dateToString(order.getOrderDate(),"dd/MM/yyyy - HH:mm:ss") %>
                            </span>                          
						</p>  
						<p>
                        	<label>Tên Deal : </label>
                            <span class="field">
                            	<%=order.getDealName() %>
                            </span>                          
						</p>  
						<p>
                        	<label>Số lượng : </label>
                            <span class="field">
                            	<%=order.getQuantity() %>
                            </span>                          
						</p> 
						<p>
                        	<label>Giá deal : </label>
                            <span class="field">
                            	<%=nf.format(order.getUnitPrice()) %> VND
                            </span>                          
						</p>  
						<p>
                        	<label>Tổng tiền : </label>
                            <span class="field">
                            	<%=nf.format(order.getTotalPrice()) %> VND
                            </span>                          
						</p>    
						<p>
                        	<label>Hình thức thanh toán : </label>
                            <span class="field">
                            	<%
								switch (order.getPaymentType()) {
									case 1: 
										%>Thanh toán trực tiếp<%
										break;																				
									default:
										%>Khác<%
										break;											
								}
								%>
                            </span>                          
						</p>     
						 <p class="stdformbutton">
                        	<a class="stdbtn" href="/admin/sell/direct">Quay lại danh sách đơn hàng</a>
                        	<%
										if(order.getStatus()!=4 &&order.getStatus()!=5 && order.getStatus()!=8 ){
							%>
                        	<a class="stdbtn" href="/admin/sell/direct?action=finish&id=<%=order.getOrderId()%>">Hoàn tất đơn hàng</a>
                        	<%
										}
                        	%>                            
                        </p>                                           												                 
                    </form>                                                           
                    <br clear="all">                    
                </div>
                <%
        			}
                %>
                <!--content-->                
            </div>
            <!--main content inner-->            
            <jsp:include page="/admin/elements/copyright.jsp">
            	<jsp:param name="language" value="1" />
			</jsp:include>            
        </div>
<jsp:include page="/admin/layouts/footer.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>